import React from 'react'
import { createContext } from 'react'

const { Consumer } = createContext()

export default function Son() {
  return (
    <div>
      <p>我是son</p>
      <p>
        接收到的颜色:
        <Consumer>{color => <span>data参数表示接收到的数据 -- {color}</span>}</Consumer>
      </p>
    </div>
  )
}
